package cc.z8g.browser

import cc.z8g.browser.core.BrowserActivity
import android.app.Activity
import android.content.Intent
import androidx.core.net.toUri

/**
 * 匿名模式
 */
class IncognitoBrowserActivity : BrowserActivity() {

    override fun getCustomThemeResId(): Int = R.style.Theme_DarkTheme

    override fun isIncognito(): Boolean = true

    override fun menuId(): Int = R.menu.incognito

    override fun homeIcon(): Int = R.drawable.incognito_mode

    companion object {
        /** 创建一个用于启动浏览器并加载可选的 [url] 的意图。 */
        fun intent(activity: Activity, url: String? = null): Intent = Intent(activity, IncognitoBrowserActivity::class.java).also {
            it.data = url?.let(String::toUri)
        }
    }
}
